package com.hrb.monkey.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.github.paolorotolo.appintro.AppIntro;
import com.github.paolorotolo.appintro.AppIntroFragment;
import com.hrb.monkey.R;
import com.hrb.monkey.ui.SlideFragment;

/**
 * APP启动页面
 */
public class IntroActivity extends AppIntro {
    @Override
    public void init(@Nullable Bundle savedInstanceState) {

        addSlide(SlideFragment.newInstance(R.layout.only_image));
        addSlide(AppIntroFragment.newInstance("First", "第一页", R.drawable.start_s, 0xfff333));
        addSlide(AppIntroFragment.newInstance("second", "第二页", R.drawable.huoguo, 0xfff333));
        addSlide(AppIntroFragment.newInstance("First", "第三页", R.drawable.monkey, 0x333333));
        addSlide(AppIntroFragment.newInstance("First", "第四页", R.drawable.ic_menu, 0xfff333));
        setVibrate(true);
        setVibrateIntensity(30);//震动
        setSkipText("跳过");
        setDoneText("完成");

    }

    @Override
    public void onSkipPressed() {
        //当执行跳过动作时触发
//        Intent intent = new Intent(IntroActivity.this, MainActivity.class);
//        startActivity(intent);
        //SpUtils.putBoolean(AppIntroActivity.this, AppConstants.FIRST_OPEN, true);
        finish();


    }

    @Override
    public void onNextPressed() {


    }

    @Override
    public void onDonePressed() {
        //当执行跳过动作时触发
//        Intent intent = new Intent(IntroActivity.this, MainActivity.class);
//        startActivity(intent);
        //SpUtils.putBoolean(AppIntroActivity.this, AppConstants.FIRST_OPEN, true);
        finish();

    }

    @Override
    public void onSlideChanged() {

    }
}
